<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width,minimum-scale=1.0,maximum-scale=1.0"/>
    <title>React 学习！！</title>
</head>
<body>
<div id="app"></div>
<script src="../bower_components/react/react.min.js"></script>
<script src="../bower_components/react/react-dom.min.js"></script>
<script src="../bower_components/react/browser.min.js"></script>
<script type="text/babel">
   
    var ReactComponent = React.createClass({
      render:function(){    
       var propsValue = "Hello React";
       console.log(this.props);
        return (  <div>
                    <h1>React Component</h1>
                    This is props value: {propsValue}
                    <input value={this.props.goods}/>
                  </div>
               )
      }
    });

    //React data bind用props和state 作为数据绑定的载体
    // 属性传递必须要在组件初始化声明属性-->可以是字符串、对象？
    // 属性传递在组件内部到底如何获取?
    // 采用Key-Value形式，在初始化的时候，属性名称={声明属性}，组件内容获取采用this.props获取
    
    var goodsTitle = "Goods name is LV";

    ReactDOM.render( <ReactComponent goods={goodsTitle}/>, 
      document.getElementById('app'),
      function(){
        console.log('渲染完成啦！！');
      }
    )
    
</script>
</body>
</html>